home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
wtek0693.zip
/
ECKEL.ZIP
/
MULTIMED.H
< prev
Wrap
C/C++ Source or Header
|
1992-07-15
|
2KB
|
62 lines
//: MULTIMED.H -- MultiMedia Classes
#ifndef MULTIMED_H_
#define MULTIMED_H_
const sz = 100;
// Note this uses the MCI string interface, but
// the implementation is hidden so you could use
// a different implementation without affecting
// the rest of the code.
class CD {
int present; // is there a CD player present?
int maxtracks; // maximum number of tracks on CD
struct songlength { int minutes, seconds; }
*length; // array of track lengths
int track, minute, second; // current CD values
char command[sz]; // for mci command string
int cd_open; // indicates whether CD is open
int open(); // insures CD is open
void update_position(); // update track, minute, second
enum { normal, fforward, frewind } state;
public:
enum when { open_now, open_later };
CD(when w = open_later);
~CD();
void play(); // plays from current position
void stop(); // stop, return to beginning
void forward_track(); // won't go past end
void backward_track(); // won't go past beginning
void rewind();
void rewind_step();
void fast_forward();
void fforward_step();
void bump() {
if (state == fforward) fforward_step();
else if (state == frewind) rewind_step();
else if (state == normal) update_position();
}
int trackNow() { return track; }
int minuteNow() { return minute; }
int secondNow() { return second; }
};
extern CD cd; // single global instance
class SoundPlayer {
protected:
char command[sz]; // for mci command string
public:
void play(char * file); // play a .WAV file
};
class SoundRecorder : public SoundPlayer {
int audio_used, recording;
public:
SoundRecorder();
~SoundRecorder();
void start_recording();
void stop_recording();
void save(char * file); // save the .WAV file just recorded
};
#endif // MULTIMED_H_